﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BTask_edit.aspx.cs" Inherits="BudgetSV.admin.business.BTask_edit" ValidateRequest="false" %>

<%@ Import Namespace="BudgetSV.Common" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>编辑管理员</title>
    <script type="text/javascript" src="../../scripts/jquery/jquery-1.10.2.min.js"></script>
    <script type="text/javascript" src="../../scripts/jquery/Validform_v5.3.2_min.js"></script>
    <script type="text/javascript" src="../../scripts/lhgdialog/lhgdialog.js?skin=idialog"></script>
    <script type="text/javascript" src="../js/layout.js?a=1"></script>
    <link href="../skin/default/style.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .Mbut_blue {
            margin: 3px;
            padding: 5px;
            background: #0888aa;
            border-radius: 5px;
            color: #fff;
            text-align: center;
            cursor: pointer;
        }

        .Mbut_blue_act {
            background: #3361b2;
        }

        .Mbut_blue:hover {
            background: #3361b2;
        }

        .Mbut_gren {
            margin: 3px;
            padding: 5px;
            background: #33b268;
            border-radius: 5px;
            color: #fff;
            text-align: center;
            cursor: pointer;
        }

        .Mbut_gren_act {
            background: #0ea04b;
        }

        .Mbut_gren:hover {
            background: #0ea04b;
        }
    </style>
    <script type="text/javascript">
        $(function () {
        });
        var W, H;
        var op = [0, 0];
        var canMove = false;
        $(function () {
            //初始化表单验证
            $("#form1").initValidform();
            ///

            W = $(window).width();
            H = $(window).height();
            $("#DialogBox").mousedown(function (e)//e鼠标事件
            {
                canMove = true;
                $(this).css("cursor", "move");//改变鼠标指针的形状
                var offset = $(this).offset();//DIV在页面的位置
                ox = e.pageX - offset.left;//获得鼠标指针离DIV元素左边界的距离
                oy = e.pageY - offset.top;//获得鼠标指针离DIV元素上边界的距离

                //var tmp = $("#mmmsg").html();
                //$("#mmmsg").html(e.pageX + "," + e.pageY + "-" + offset.left + "," + offset.top);
            });
            $(document).mousemove(function (ev)//绑定鼠标的移动事件，因为光标在DIV元素外面也要有效果，所以要用doucment的事件，而不用DIV元素的事件
            {
                if (canMove) {
                    $("#DialogBox").stop();//加上这个之后

                    var _x = ev.pageX - ox;//获得X轴方向移动的值
                    var _y = ev.pageY - oy;//获得Y轴方向移动的值

                    //var tmp = $("#mmmsg").html();
                    //$("#mmmsg").html(tmp + "<br />" + ev.pageX + "," + ev.pageY + "-" + _x + "," + _y);
                    $("#DialogBox").animate({ left: _x + "px", top: _y + "px" }, 10);
                }
            }).mouseup(function () {
                canMove = false;
                $("#DialogBox").css("cursor", "default");
            });

            $(".roleit").change(function () {
                var sv = $(this).val();
                var stx = $(this).attr("data-name");

                var ov = $("#RoleIds").val();
                var otx = $("#Roles").val();

                if ($(this).is(':checked')) {
                    if (ov.indexOf("," + sv + ",") < 0) {
                        ov += sv + ",";
                        otx += stx + ",";
                    }

                } else {
                    if (ov.indexOf("," + sv + ",") >= 0) {
                        ov = ov.replace(sv + ",", "");
                        otx = otx.replace(stx + ",", "");
                    }
                }
                $("#RoleIds").val(ov);
                $("#Roles").val(otx);
            });
        });
        function choserolers() {
            $("#DialogFace").css("width", W + "px").css("height", H + "px").css("display", "block").children("div").css("top", (H - 350) / 2 + "px").css("left", (W - 400) / 2 + "px");
        }
        function CancelFunc() {
            $("#DialogFace").css("display", "none");
        }
        function OkFunc() {
            $("#Roles").blur();
            $("#DialogFace").css("display", "none");
        }

    </script>
</head>

<body class="mainbody">
    <form id="form1" runat="server">
        <div id="mmmsg" style="position:fixed;top:20px;left:20px;"></div>
        <!--导航栏-->
        <div class="location">
            <a href="BTask_list.aspx" class="back"><i></i><span>返回列表页</span></a>
            <a href="javascript:parent.location.reload()" class="home"><i></i><span>首页</span></a>
            <i class="arrow"></i>
            <a href="BTask_list.aspx"><span>管理员</span></a>
            <i class="arrow"></i>
            <span>编辑管理员</span>
        </div>
        <div class="line10"></div>
        <!--/导航栏-->

        <!--内容-->
        <div class="content-tab-wrap">
            <div id="floatHead" class="content-tab">
                <div class="content-tab-ul-wrap">
                    <ul>
                        <li><a href="javascript:;" onclick="tabs(this);" class="selected">编辑管理员</a></li>
                    </ul>
                </div>
            </div>
        </div>

        <div class="tab-content">
            <dl>
                <dt>排序数字</dt>
                <dd>
                    <asp:TextBox ID="txtSortId" runat="server" CssClass="input small" datatype="n" sucmsg=" ">99</asp:TextBox>
                    <span class="Validform_checktip">*数字，越小越向前</span>
                </dd>
            </dl>
            <dl>
                <dt>所在组织机构</dt>
                <dd>
                    <div class="rule-single-select">
                        <asp:DropDownList ID="DropDownList1" runat="server" datatype="n" errormsg="请选择组织机构" sucmsg=" " AutoPostBack="True" OnSelectedIndexChanged="departid_change"></asp:DropDownList>
                    </div>
                </dd>
            </dl>
            <dl>
                <dt>所在部门</dt>
                <dd>
                    <div class="rule-single-select">
                        <asp:DropDownList ID="ddlDepartId" runat="server"></asp:DropDownList>
                    </div>
                </dd>
            </dl>
            <dl>
                <dt>管理角色</dt>
                <dd>
                    <asp:HiddenField ID="ORoleIds" runat="server" />
                    <asp:HiddenField ID="RoleIds" runat="server" />
                    <asp:TextBox ID="Roles" onclick="choserolers();" runat="server" CssClass="input normal" ReadOnly="true" datatype="*" errormsg="请选择管理角色"></asp:TextBox>
                    <span class="Validform_checktip">*请选择管理角色</span>
                </dd>
            </dl>
            <dl>
                <dt>是否领导</dt>
                <dd>
                    <div class="rule-single-checkbox">
                        <asp:CheckBox ID="cbIsLeader" runat="server" Checked="False" />
                    </div>
                    <span class="Validform_checktip">*</span>
                </dd>
            </dl>
            <dl>
                <dt>是否启用</dt>
                <dd>
                    <div class="rule-single-checkbox">
                        <asp:CheckBox ID="cbIsLock" runat="server" Checked="True" />
                    </div>
                    <span class="Validform_checktip">*不启用则无法使用该账户登录</span>
                </dd>
            </dl>
            <dl>
                <dt>登录密码</dt>
                <dd>
                    <asp:TextBox ID="txtPassword" runat="server" CssClass="input normal" TextMode="Password" datatype="*6-20" nullmsg="请设置密码" errormsg="密码范围在6-20位之间" sucmsg=" "></asp:TextBox>
                    <span class="Validform_checktip">*</span></dd>
            </dl>
            <dl>
                <dt>确认密码</dt>
                <dd>
                    <asp:TextBox ID="txtPassword1" runat="server" CssClass="input normal" TextMode="Password" datatype="*" recheck="txtPassword" nullmsg="请再输入一次密码" errormsg="两次输入的密码不一致" sucmsg=" "></asp:TextBox>
                    <span class="Validform_checktip">*</span></dd>
            </dl>
            <dl>
                <dt>姓名</dt>
                <dd>
                    <asp:TextBox ID="txtRealName" runat="server" CssClass="input normal"></asp:TextBox></dd>
            </dl>
            <dl>
                <dt>电话</dt>
                <dd>
                    <asp:TextBox ID="txtTelephone" runat="server" CssClass="input normal"></asp:TextBox></dd>
            </dl>
            <dl>
                <dt>邮箱</dt>
                <dd>
                    <asp:TextBox ID="txtEmail" runat="server" CssClass="input normal"></asp:TextBox></dd>
            </dl>
        </div>
        <!--/内容-->

        <!--工具栏-->
        <div class="page-footer">
            <div class="btn-list">
                <asp:Button ID="btnSubmit" runat="server" Text="提交保存" CssClass="btn" OnClick="btnSubmit_Click" />
                <input name="btnReturn" type="button" value="返回上一页" class="btn yellow" onclick="javascript: history.back(-1);" />
            </div>
            <div class="clear"></div>
        </div>

        <!--/工具栏-->

        <div id="DialogFace" style="display: none; width: 100%; min-height: 100px; background: rgba(204, 203, 203, 0.80); position: absolute; top: 0; left: 0; z-index: 800;">
            <div id="DialogBox" style="width: 400px; height: 350px; background: #fff; border: solid 1px #888; position: absolute; border-radius: 5px; margin: auto; overflow: hidden;">
                <div id="DialogTitle" style="width: 100%; height: 25px; padding-top: 5px; text-align: center; color: #fff; background: #0888aa; font-weight: 700; font-size: 18px;">选择角色</div>
                <div style="width: 100%; height: 250px; margin-top: 20px; overflow: auto;">
                    <table style="width: 80%;">
                        <%--<%=roleHtml %>--%>
                        <%--<tr style="height:25px;">
                            <td style="width:20%;text-align:center;">
                                <input class="roleit" type="checkbox" value="1" data-name="aaa" checked="checked" /></td>
                            <td style="width:80%;">aaa</td>
                        </tr>--%>
                    </table>
                </div>
                <div style="width: 100%; height: 40px; margin-top: 10px;">
                    <div onclick="OkFunc();" style="width: 20%; float: left; margin-left: 20%; height: 30px;">
                        <div class="Mbut_blue">确定选择</div>
                    </div>
                    <div onclick="CancelFunc();" style="width: 20%; float: left; margin-left: 20%; height: 30px;">
                        <div class="Mbut_blue">取消</div>
                    </div>
                </div>
            </div>
        </div>

    </form>
</body>
</html>
